param($sourceServer, $sourceDatabase, $destinationServer, $destinationDatabase)

$tableNames = "Project","Noun","Verb","VerbException","Cmdlet","CmdletParameter","ParameterSetEntry","UserPermission","HelpExample","SpecHistory"

foreach($tableName in $tableNames)
{
    Write-Progress "Importing $tableName" "Reading from source server"
    $sqlBatch = .\Generate-DataTransferSql $sourceServer $sourceDatabase $tableName
    $counter = 1
    $total = $sqlBatch.Count

    foreach($statement in $sqlBatch)
    {
        Write-Progress "Importing $tableName" "$counter of $total" -Percent ($counter / $total * 100)
        .\Invoke-SqlCommand $destinationServer $destinationDatabase $statement
        $counter++
    }
}

